package com.dng.book.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 书籍实体类
 *
 * @author dng
 * @since 2024-01-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("T_BOOK")
@Schema(description = "书籍实体")
public class Book {

    @Schema(description = "ID")
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    @Schema(description = "书籍名")
    @TableField("BOOK_NAME")
    private String bookName;

    @Schema(description = "ISBN号")
    @TableField("ISBN")
    private String isbn;

    @Schema(description = "出版社")
    @TableField("PUBLISHER")
    private String publisher;

    @Schema(description = "价格")
    @TableField("PRICE")
    private BigDecimal price;

    @Schema(description = "出版日期")
    @TableField("PUBLISH_DATE")
    private LocalDate publishDate;

    @Schema(description = "创建人")
    @TableField("CREATED_BY")
    private String createdBy;

    @Schema(description = "创建时间")
    @TableField("CREATED_TIME")
    private LocalDateTime createdTime;

    @Schema(description = "更新人")
    @TableField("UPDATED_BY")
    private String updatedBy;

    @Schema(description = "更新时间")
    @TableField("UPDATED_TIME")
    private LocalDateTime updatedTime;

    @Schema(description = "删除标识 0：未删除1：已删除默认：0")
    @TableField("DEL_FLAG")
    @TableLogic
    private String delFlag;

    @Schema(description = "乐观锁")
    @TableField("REVISION")
    @Version
    private Integer revision;

    @Schema(description = "备注")
    @TableField("NOTE")
    private String note;
} 